import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(A(n));
    }
    public static int A(int n) {
        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        for(int i = 2; i <= n; i++) {
            for(int j = 1; j < i; j++) {
                if(!B(j + i)) {
                    dp[i] += dp[j];
                }
            }
        }
        return dp[n];
    }
    public static boolean B(int n) {
        if(n < 2) {
            return false;
        }
        for(int i = 2; i < Math.sqrt(n); i++) {
            if(n % i == 0) {
                return false;
            }
        }
        return true;
    }
}
